-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document the 'experimental.config.utils.schema' module #4469
Conversation
f01f27b
to
cce41ab
Compare
cce41ab
to
cece8ac
Compare
e5435c9
to
123b26e
Compare
35000a1
to
2bfc0ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strict objections from my side.
There are points that require some polishing, but everything is generally good.
Thanks for working on it!
Schema nodes describe the hierarchy of options within a schema. There are two types of schema nodes: | ||
|
||
- *Scalar* nodes hold a single value of a supported primitive type. For example, | ||
a string configuration option of a role is a scalar node its schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a string configuration option of a role is a scalar node its schema. | |
a string configuration option of a role is a scalar node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the missing preposition
- a string in the dot notation | ||
- an array-like table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- a string in the dot notation | |
- an array-like table | |
- a string in the dot notation | |
- an array-like table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
.. method:: pairs() | ||
|
||
Walk over the schema and return scalar, array, and map schema nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above, in the reference summary, we annotate the function as "Traverse a configuration". "Walk over" and "traverse" are synonyms, but I'd rather not use them interchangeably for annotating the same function in order to avoid confusion for non-native technical readers. I'd vote for "walk over" in both places.
doc/platform/app/app_roles.rst
Outdated
|
||
.. _roles_create_custom_role_validate: | ||
|
||
Validating a role configuration | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To validate a role's configuration, you need to define the :ref:`validate([cfg]) <roles_api_reference_validate>` function. | ||
To validate a role configuration, you need to define the :ref:`validate([cfg]) <roles_api_reference_validate>` function. | ||
The ``cfg`` argument provides access to the :ref:`role's configuration <roles_create_custom_role_config>` and check its validity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ``cfg`` argument provides access to the :ref:`role's configuration <roles_create_custom_role_config>` and check its validity. | |
The ``cfg`` argument provides access to the :ref:`role's configuration <roles_create_custom_role_config>` and checks its validity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence seems irrelevant with the new schema validation module, I'm removing it. Thanks for spotting.
Co-authored-by: Elena Shebunyaeva <elena.shebunyaeva@gmail.com>
Fixes #4279.
New samples
The following new samples were added to demonstrate the main use cases of this module.
Config hierarchy
config_schema_nodes_scalar
config_schema_nodes_record
config_schema_nodes_record_hierarchy
(based onconfig_schema_node_record
)config_schema_nodes_array
(based onconfig_schema_node_record
)config_schema_nodes_map
(based onconfig_schema_node_record
)Annotations
config_schema_annotations
(based onconfig_schema_node_record
)Helper methods
config_schema_methods
(based onconfig_schema_node_record
)Environment variables
config_schema_fromenv
(based onconfig_schema_node_record
)Computed annotations
config_schema_computed_annotations
(based onconfig_schema_nodes_record_hierarchy
)Updated samples
The
application_role_http_api
sample has been updated to use the new module.Docs